package com.lhgray.sglhome.data.repository

import com.freightoa.foundation.net.ApiResult
import com.freightoa.foundation.presentation.repository.BaseRepository
import com.lhgray.sglhome.data.network.api.HomeServer
import javax.inject.Inject

class HomeRepository @Inject constructor() : BaseRepository {

  @Inject
    lateinit var homeServer: HomeServer
    suspend fun login(username: String, password: String): Result<String> {

        // 模拟登录逻辑

       return when(homeServer.getLogin(username,password,"")){
            is ApiResult.Success->{
                Result.success("")
            }
            is ApiResult.Error->{Result.failure(RuntimeException("13"))}
            is ApiResult.Exception -> {Result.failure(RuntimeException("13"))}
        }
    }
}